<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     template="../../Template.xhtml"
>
<ui:define name="title">Manage Advertisers</ui:define>
<ui:define name="body">


<h:form id="form">
<br/><br/>
<p:panelGrid columns="2">

<h2>Manage Advertisers</h2>
<p:commandButton ajax="false" value="Add New" action="AddAdvertisers.xhtml" />
   
</p:panelGrid>
<br/><br/><br/><br/>
 <p:growl id="msgs" showDetail="true"  />
    <p:dataTable id="basicDT" var="car" value="#{advertisersMB.listAnnonceurs}" rows="10"
                         paginator="true"
                         paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                         rowsPerPageTemplate="5,10,15" >
      
        <p:column headerText="Id">
            <h:outputText value="#{car.idAnnonceur}" />
        </p:column>
        <p:column headerText="First Name">
        
             <h:outputText value="#{car.nom}" />
       </p:column>
        <p:column headerText="Last Name">
              <h:outputText value="#{car.prenom}" />
      
        </p:column>
         <p:column headerText="Addresse">
              <h:outputText value="#{car.adresse}" />
      
        </p:column>
         <p:column headerText="Phone Number">
              <h:outputText value="#{car.telephone}" />
      
        </p:column>
         <p:column headerText="Fax">
              <h:outputText value="#{car.fax}" />
      
        </p:column>
         <p:column headerText="Status">
              <h:outputText value="#{car.statut}" />
      
        </p:column>
        <p:column style="width:32px;text-align: center">
             <p:commandButton update=":form:carDetail" oncomplete="carDialog.show()" icon="ui-icon-search" title="View">
                <f:setPropertyActionListener value="#{car}" target="#{advertisersMB.annonceur}" />
            </p:commandButton>
             <p:commandButton ajax="false" action="#{advertisersMB.edit(car.idAnnonceur)}" icon="ui-icon ui-icon-pencil">
            </p:commandButton>
            <p:commandButton ajax="false" action="#{advertisersMB.Supprimer(car.idAnnonceur)}" icon="ui-icon ui-icon-close">
            </p:commandButton>
         </p:column>
    </p:dataTable>
     <p:dialog header="Country details" widgetVar="carDialog" modal="true" showEffect="fade" hideEffect="fade" resizable="false">
        <p:outputPanel id="carDetail" style="text-align:center;">
            <p:panelGrid  columns="2"  columnClasses="label,value">
                <h:outputText value="Id:" />
                <h:outputText value="#{advertisersMB.annonceur.idAnnonceur}" />
                <h:outputText value="FirstName:" />
                <h:outputText value="#{advertisersMB.annonceur.nom}" />
                <h:outputText value="LastName:" />
                <h:outputText value="#{advertisersMB.annonceur.prenom}" />
                <h:outputText value="Phone Number:" />
                <h:outputText value="#{advertisersMB.annonceur.telephone}" />
                <h:outputText value="fax:" />
                <h:outputText value="#{advertisersMB.annonceur.fax}" />
                 <h:outputText value="Status:" />
                <h:outputText value="#{advertisersMB.annonceur.statut}" />
            </p:panelGrid>
        </p:outputPanel>
    </p:dialog>
 </h:form>
 <br/><br/><br/><br/>
</ui:define>

</ui:composition>